import ElImageViewer from "element-ui/packages/image/src/image-viewer";
import Vue from "vue";
let _url;
let ElImg = Vue.extend({
    components: {ElImageViewer},
    template: '<el-image-viewer v-if="elImageViewerVisible" :z-index="4000" :on-close="() => {elImageViewerVisible = false}" :url-list="elImageViewerList" />',
    data: function () {
        return {
            elImageViewerVisible: true,
            elImageViewerList: [_url]
        }
    }
})

export const previewImg = (url) => {
    _url = url
    let component = new ElImg().$mount()
    document.body.appendChild(component.$el)
}

